{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "from sklearn.tree import DecisionTreeClassifier\n",
    "from sklearn.datasets import make_classification\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import classification_report"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 载入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>density</th>\n",
       "      <th>sugar</th>\n",
       "      <th>good</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.697</td>\n",
       "      <td>0.460</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.774</td>\n",
       "      <td>0.376</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.634</td>\n",
       "      <td>0.264</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.608</td>\n",
       "      <td>0.318</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.556</td>\n",
       "      <td>0.215</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   density  sugar good\n",
       "0    0.697  0.460    是\n",
       "1    0.774  0.376    是\n",
       "2    0.634  0.264    是\n",
       "3    0.608  0.318    是\n",
       "4    0.556  0.215    是"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv(\"../data/watermelon.csv\")\n",
    "data.columns = [\"id\", \"density\", \"sugar\", \"good\"]\n",
    "data = data[[\"density\", \"sugar\", \"good\"]]\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>density</th>\n",
       "      <th>sugar</th>\n",
       "      <th>good</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.697</td>\n",
       "      <td>0.460</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.774</td>\n",
       "      <td>0.376</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.634</td>\n",
       "      <td>0.264</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.608</td>\n",
       "      <td>0.318</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.556</td>\n",
       "      <td>0.215</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   density  sugar  good\n",
       "0    0.697  0.460     1\n",
       "1    0.774  0.376     1\n",
       "2    0.634  0.264     1\n",
       "3    0.608  0.318     1\n",
       "4    0.556  0.215     1"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['good'] = data['good'].apply(lambda x: 1 if x == '是' else 0)\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = data.values[:, :2]\n",
    "y = data.values[:, 2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "    X, y, test_size=0.05, random_state=42)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3个基分类器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AdaBoostClassifier(algorithm='SAMME.R',\n",
       "                   base_estimator=DecisionTreeClassifier(ccp_alpha=0.0,\n",
       "                                                         class_weight=None,\n",
       "                                                         criterion='gini',\n",
       "                                                         max_depth=1,\n",
       "                                                         max_features=None,\n",
       "                                                         max_leaf_nodes=None,\n",
       "                                                         min_impurity_decrease=0.0,\n",
       "                                                         min_impurity_split=None,\n",
       "                                                         min_samples_leaf=1,\n",
       "                                                         min_samples_split=2,\n",
       "                                                         min_weight_fraction_leaf=0.0,\n",
       "                                                         presort='deprecated',\n",
       "                                                         random_state=None,\n",
       "                                                         splitter='best'),\n",
       "                   learning_rate=0.5, n_estimators=3, random_state=42)"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf3 = AdaBoostClassifier(DecisionTreeClassifier(max_depth=1), \n",
    "                          n_estimators=3, learning_rate=0.5, random_state=42)\n",
    "clf3.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "         0.0       0.90      1.00      0.95         9\n",
      "         1.0       1.00      0.86      0.92         7\n",
      "\n",
      "    accuracy                           0.94        16\n",
      "   macro avg       0.95      0.93      0.94        16\n",
      "weighted avg       0.94      0.94      0.94        16\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 训练集\n",
    "y_train_pred = clf3.predict(X_train)\n",
    "print(classification_report(y_train, y_train_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "         1.0       1.00      1.00      1.00         1\n",
      "\n",
      "    accuracy                           1.00         1\n",
      "   macro avg       1.00      1.00      1.00         1\n",
      "weighted avg       1.00      1.00      1.00         1\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 测试集\n",
    "y_pred = clf3.predict(X_test)\n",
    "print(classification_report(y_test, y_pred))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面的做图函数参考[官方文档](https://scikit-learn.org/stable/auto_examples/ensemble/plot_adaboost_twoclass.html#sphx-glr-auto-examples-ensemble-plot-adaboost-twoclass-py)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [],
   "source": [
    "def counterPlot(X, y, clf):\n",
    "    plot_colors = \"br\"\n",
    "    plot_step = 0.02\n",
    "    class_names = \"01\"\n",
    "\n",
    "    plt.figure(figsize=(10, 5))\n",
    "\n",
    "    # Plot the decision boundaries\n",
    "    x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1\n",
    "    y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1\n",
    "    xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step),\n",
    "                         np.arange(y_min, y_max, plot_step))\n",
    "\n",
    "    Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])\n",
    "    Z = Z.reshape(xx.shape)\n",
    "    cs = plt.contourf(xx, yy, Z, cmap=plt.cm.Paired)\n",
    "    plt.axis(\"tight\")\n",
    "    # Plot the training points\n",
    "    for i, n, c in zip(range(2), class_names, plot_colors):\n",
    "        idx = np.where(y == i)\n",
    "        plt.scatter(X[idx, 0], X[idx, 1],\n",
    "                    c=c, cmap=plt.cm.Paired,\n",
    "                    s=20, edgecolor='k',\n",
    "                    label=\"Class %s\" % n)\n",
    "    plt.xlim(x_min, x_max)\n",
    "    plt.ylim(y_min, y_max)\n",
    "    plt.legend(loc='upper right')\n",
    "    plt.xlabel('x')\n",
    "    plt.ylabel('y')\n",
    "    plt.title('Decision Boundary')\n",
    "    \n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmkAAAFNCAYAAABbpPhvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deZgdVZ3/8fc36SYBhJB0SCAhAVlmFCQ/dALIFgPIGBhNhAEGnAEUEERZ1GEXE0FBFMZd0bAMi8OioNhq0HEBQRFJUAwQYAhLlg4hq1kgS3fn/P64N/EmdKe7k+5bpzvv1/P0k7pVp6u+9xY3fHKqTp1IKSFJkqS89Cq6AEmSJL2ZIU2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OKaVXy93081rZR0P5z5ci4iHgnYAhrboagMoell3K61pqMzsiaoB+wMLqlKdWtHneUkqV5+gm4MtVqEubrz3fSWUmpbS0YnlSRHwnIgamlLakOT293NlN1AOnlZdPA36yYYOI6B8RfcrLA4FDgGlVq1BrTQb2ioi3RsRWwEmUzl+lyvN5PPDb5AMLi9bmedvgPqaxwLNVrE+brh44tTzK893AkorbR5SpiNhp7b26EXEApbyyxf1j1p607uFa4AcRcQYwAzgRICJGAh9LKZ0JvB34XkSsofQf87UpJUNalaWUmiLiXOCXQG/glpTSMxFxFTAlpVQP3AzcERHTKd04e1JxFQvafd7Oj4ixQBOl8/bhwgrWOhFxFzAaGBgRs4EJQC1ASum7wCTgGGA68AbwkWIqVaV2nLfjgXMioglYAZy0Jf5j1hkHJEmSMuTlTkmSpAwZ0iRJkjJkSJMkScqQIU2SJClDhjRJkqQMGdIkSZIyZEiTJEnKkCFNkjYiIvYvT6reNyK2jYhnIuIdRdclqefzYbaS1IaI+ALQF9gamJ1S+mLBJUnaAhjSJKkN5fk8JwMrgYNTSs0FlyRpC+DlTklqWx3wFmA7Sj1qktTl7EmTpDZERD1wN/BWYOeU0rkFlyRpC1BTdAGSlLOIOBVoTCndGRG9gUcj4oiU0m+Lrk1Sz2ZPmiRJUoa8J02SJClDhjRJkqQMGdIkSZIyZEiTJEnKkCFNkiQpQ4Y0SZKkDBnSJEmSMmRIkyRJytD/BwNliV7ZYmuhAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "counterPlot(X, y, clf3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 5个基分类器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training data: \n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "         0.0       1.00      1.00      1.00         9\n",
      "         1.0       1.00      1.00      1.00         7\n",
      "\n",
      "    accuracy                           1.00        16\n",
      "   macro avg       1.00      1.00      1.00        16\n",
      "weighted avg       1.00      1.00      1.00        16\n",
      "\n",
      "Test data: \n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "         1.0       1.00      1.00      1.00         1\n",
      "\n",
      "    accuracy                           1.00         1\n",
      "   macro avg       1.00      1.00      1.00         1\n",
      "weighted avg       1.00      1.00      1.00         1\n",
      "\n"
     ]
    }
   ],
   "source": [
    "clf5 = AdaBoostClassifier(DecisionTreeClassifier(max_depth=1), \n",
    "                          n_estimators=5, learning_rate=0.5, random_state=42)\n",
    "clf5.fit(X_train, y_train)\n",
    "# 训练集\n",
    "print(\"Training data: \")\n",
    "y_train_pred = clf5.predict(X_train)\n",
    "print(classification_report(y_train, y_train_pred))\n",
    "# 测试集\n",
    "print(\"Test data: \")\n",
    "y_pred = clf5.predict(X_test)\n",
    "print(classification_report(y_test, y_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmkAAAFNCAYAAABbpPhvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deZwV1Z338c8PGiFuCI2oIEg0zqhRHpNxiRoJapwHTYLRMY5mxiVqcIxbknHXiBo1Js48idlMUBmXGZeMJqZN0IxJJDFxAxODCxpR2RqRVRYFoZvz/HEvzAW66W7ovnW6+bxfr35Rt+p01e/e8uKXOnXqREoJSZIk5aVb0QVIkiRpfYY0SZKkDBnSJEmSMmRIkyRJypAhTZIkKUOGNEmSpAwZ0iR1ChHxSESc2op2SyNi12rUVJSImBoRnyy6Dkkdq6boAiR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kjJkSJMkScqQIU2SJClDhjRJkqQMGdIkaQMiYv/ypOq9ImKriHgpIvYuui5JXZ8Ps5WkFkTEdUAv4APAzJTSNwouSdJmwJAmSS0oz+c5AVgOHJxSaiy4JEmbAbs7JalltcDWwDaUrqhJUofzSpoktSAi6oD7gA8CO6WUzi24JEmbgZqiC5CknEXEKcDKlNI9EdEdeDIiDk8p/bbo2iR1bV5JkyRJypD3pEmSJGXIkCZJkpQhQ5okSVKGDGmSJEkZMqRJkiRlyJAmSZKUIUOaJElShgxpkiRJGfr/FHtrxWeu9XgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "counterPlot(X, y, clf5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 11个基分类器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training data: \n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "         0.0       1.00      1.00      1.00         9\n",
      "         1.0       1.00      1.00      1.00         7\n",
      "\n",
      "    accuracy                           1.00        16\n",
      "   macro avg       1.00      1.00      1.00        16\n",
      "weighted avg       1.00      1.00      1.00        16\n",
      "\n",
      "Test data: \n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "         1.0       1.00      1.00      1.00         1\n",
      "\n",
      "    accuracy                           1.00         1\n",
      "   macro avg       1.00      1.00      1.00         1\n",
      "weighted avg       1.00      1.00      1.00         1\n",
      "\n"
     ]
    }
   ],
   "source": [
    "clf11 = AdaBoostClassifier(DecisionTreeClassifier(max_depth=1), \n",
    "                          n_estimators=11, learning_rate=0.5, random_state=42)\n",
    "clf11.fit(X_train, y_train)\n",
    "# 训练集\n",
    "print(\"Training data: \")\n",
    "y_train_pred = clf11.predict(X_train)\n",
    "print(classification_report(y_train, y_train_pred))\n",
    "# 测试集\n",
    "print(\"Test data: \")\n",
    "y_pred = clf5.predict(X_test)\n",
    "print(classification_report(y_test, y_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmkAAAFNCAYAAABbpPhvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3de5yWdZ3/8dcHBkFNEQZBzqa5Wx74WYtamoSaG7IF6aZpu2qp4VoeqvWciZqa5W5ns1BZD7seSkvHQtvKQ5ZpYhkqaOKBwyByDFBBmJnv74/7hr3BgZmBmfv6zvB6Ph7z4Lqv6zvX9bnvyxvfXN/re30jpYQkSZLy0q3oAiRJkvR2hjRJkqQMGdIkSZIyZEiTJEnKkCFNkiQpQ4Y0SZKkDBnSJHUKEXFfRJzYinavR8Ru1aipKBHxSkR8uOg6JHWsmqILkNR1RMQrwACgAWgEpgM3A5NSSk1bsu+U0hGtbPeOLTnOxlS8t0ZgDfAo8G8ppTkdcTxJ8kqapPb2sZTSDsBw4CrgPOCGYktqNx8rh8CBwGvA9wqup00iwn+YS52IIU1Sh0gpLUsp1QGfBE6MiL0BIqJnRPxHRMyOiNci4ocRse3a34uI8RHxVEQsj4gXI2JMef1DEXFKefldEfFwRCyLiEURcUfF76eIeFd5uXdE3BwRCyNiVkRcFBHdyts+HRG/K9eyNCJejojWXq1bBdwJ7Flx3E0d65KI+O+KtruW66ypeG9fjYjfR8SKiPjfiOhX0f748j4XR8SXK2uJiP0j4g8R8beIeDUivh8R22zweXw+Il4AXoiIayLiPzfYR11EfLE1711S9RjSJHWolNIfgbnAweVVVwF/B+wLvAsYDFwMpcBBqXv0HGAnYBTwSjO7/Srwv0AfYAgbv6L1PaA3s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1JKt0ZEd+DRiDg0pfRA0bVJ6tq8kiZJkpQh70mTJEnKkCFNkiQpQ4Y0SZKkDBnSJEmSMmRIkyRJypAhTZIkKUOGNEmSpAwZ0iRJkjL0/wHElqNG7VYH2gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "counterPlot(X, y, clf11)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ML",
   "language": "python",
   "name": "ml"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
